/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.site.user.pojo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author zhanjun
 */
@Embeddable
public class TbPrivilegePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_RESOURCE")
    private String idResource;
    @Basic(optional = false)
    @Column(name = "ID_OPERATOR")
    private String idOperator;
    @Basic(optional = false)
    @Column(name = "ID_ROLE")
    private String idRole;

    public TbPrivilegePK() {
    }

    public TbPrivilegePK(String idResource, String idOperator, String idRole) {
        this.idResource = idResource;
        this.idOperator = idOperator;
        this.idRole = idRole;
    }

    public String getIdResource() {
        return idResource;
    }

    public void setIdResource(String idResource) {
        this.idResource = idResource;
    }

    public String getIdOperator() {
        return idOperator;
    }

    public void setIdOperator(String idOperator) {
        this.idOperator = idOperator;
    }

    public String getIdRole() {
        return idRole;
    }

    public void setIdRole(String idRole) {
        this.idRole = idRole;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idResource != null ? idResource.hashCode() : 0);
        hash += (idOperator != null ? idOperator.hashCode() : 0);
        hash += (idRole != null ? idRole.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbPrivilegePK)) {
            return false;
        }
        TbPrivilegePK other = (TbPrivilegePK) object;
        if ((this.idResource == null && other.idResource != null) || (this.idResource != null && !this.idResource.equals(other.idResource))) {
            return false;
        }
        if ((this.idOperator == null && other.idOperator != null) || (this.idOperator != null && !this.idOperator.equals(other.idOperator))) {
            return false;
        }
        if ((this.idRole == null && other.idRole != null) || (this.idRole != null && !this.idRole.equals(other.idRole))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.site.user.pojo.TbPrivilegePK[idResource=" + idResource + ", idOperator=" + idOperator + ", idRole=" + idRole + "]";
    }

}
